<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>个股详情</title>
		<link href="css/text.css" rel="stylesheet" type="text/css" />
		<style type="text/css">				
			p {margin:1px;}					
			ul {margin:1px;}			
			h4 {margin:0px}	
			#towriter{
				margin-top:-15px;
				border: 1px solid #555555;
				white-space: normal;											
			}
			.fixedBox{					
				white-space: nowrap;	
			}
			.fixedBox::-webkit-scrollbar {
				width: 12px;     
				height: 12px;				
			}
			table{
				width:180px; 
				border-collapse:collapse; 
				text-align:center;
			}
			td,th{border:1px solid #696969}	
		</style>
	</head>
	<body>
		<div id="towriter" class="fixedBox"	style="display:none;">
			<div id="towrite1" ></div>
			<div id="towrite" style="margin-top:-10px">				
				<!-- <div id="towrite2" style="border: 1px solid #E5E5E5; float: left;"></div> -->
				<div id="towrite2" class="fixedBox" style="position:relative; float:left;"></div>
				<div id="towrite3" class="fixedBox" style="position:relative; float:left;"></div>			
			</div>
		</div>			
		<script type="text/javascript" src="js/json2html.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script>
			var bkcolor = $("body").css("backgroundColor");
			var ztxq = 0;  //默认显示涨停原因(0:不显示；1:显示)
			var sdxq = 0;  //默认显示同花顺速递(0:不显示；1:显示)
			var rdxq = 0;  //默认显示东财热点(0:不显示；1:显示)
			var zdycolor = "#FF00FF";  //自定义板块颜色
			
			var dt = "";
			var tt = "";
			var gt = "";
			var bka = "";
			var bkb = "";	
			window.onload = function() {
				var text = load("个股详情自定义板块.txt");
				bka = text.split("[高亮板块]")[1].split("[过滤板块]")[0];			
				bkb = text.split("[过滤板块]")[1];			
				var day = new Date();
				gt = day.getTime();
				mymonth = day.getMonth()+1;
				myday = day.getDate();
				if(mymonth >= 10){mymonth = mymonth;}else{mymonth = "0" + mymonth;}
				if(myday >= 10){myday = myday;}else{myday = "0" + myday;}
				tt = day.getFullYear() + "-" + mymonth + "-" + myday;						
				dt = tt;
				
				changeStyle();
				getSource();
			}
			
			function load(name) {
				var xhr = new XMLHttpRequest()							
				okStatus = document.location.protocol === "file:" ? 0 : 200;				
				xhr.open('GET', name, false);
				xhr.overrideMimeType("text/html;charset=gb2312");//默认为utf-8				
				xhr.send(null);
				return xhr.status === okStatus ? xhr.responseText : null;
			}
			
			var z = 1;  //自动刷新按钮
			$(function() {
				setInterval(function() {
					if(z == 1){					
						getSource();										
					}					
				},
				1000);
			})
			
			function time_range(beginTime, endTime) {
				var strb = beginTime.split(":");
				if (strb.length != 2) {
					return false;
				}

				var stre = endTime.split(":");
				if (stre.length != 2) {
					return false;
				}

				var b = new Date();
				var e = new Date();
				var n = new Date();

				b.setHours(strb[0]);
				b.setMinutes(strb[1]);
				e.setHours(stre[0]);
				e.setMinutes(stre[1]);

				if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
					hqsx();					
					console.log(true)　　　　　　
					return true;				
				} else {
					console.log(false)
				    return false;     
				}
			}　　　
			
			//同股状态下刷新
			$(function() {
				setInterval(function() {
					if(k == 0 && q == 0){
						time_range("09:00","15:15")																			
					}					
				},
				60000);
			})
			
			function thclick() {
				if(rn < 2 || rn > 5){
					sfx = 1;
					var table = document.getElementById('towrite3').getElementsByTagName("table")[0];
					var headers = table.getElementsByTagName("th");
					headers[rn].onclick();
				}
			}
			
			var ds = 0;
			function hqsx() {
				ds = 1;
				if(z == 0){  //停止自动刷新时，也可以刷新当前股票
					//writeSource1();   //涨停原因
					//updatex();
					writeSource2();   //精选板块					
					thclick();											
					changeTCss(objt,trid,"gg")
					ds = 0;	
				}
			}
			
			function changeStyle() {
				var obj = document.getElementById("towriter");
				obj.style.display= "block"; 				
				obj.style.left= "0px"; 				
				obj.style.width= "480px";	
				obj.style.height= "630px";		
								
				var obj1 = document.getElementById("towrite1");	//上部				
				obj1.style.fontSize="13px";	
				obj1.style.minHeight= "10px";  //最小高度，自动高度						
				
				var obj2 = document.getElementById("towrite2"); //左下
				obj2.style.left= "0px"; 				
				obj2.style.width= "200px";	
				obj2.style.height= "500px";	
				obj2.style.fontSize="12px";	
				obj2.style.marginTop= "-10px";
				
				var obj3 = document.getElementById("towrite3"); //右下
				obj3.style.left= "0px"; 
				obj3.style.width= "230px";
				obj3.style.height= "500px";
				obj3.style.fontSize ="12px";
				obj3.style.marginTop= "-10px";
				obj3.style.marginLeft = "2px";  		
			}			
			
			
			function keepTwoDecimal(num) {  
				var result = parseFloat(num);  
				if (isNaN(result)) {  
					//alert('传递参数错误，请检查！');  
					return false;  
				}  
				result = Math.round(num * 100) / 100;  
				return result;  
			};
			
			function NumberTransform(num) { 
				var result = num;
               if(Math.abs(num) > 100000000){
			    result = num / 100000000;
				result = result.toFixed(2) + "亿";
			   }else if(Math.abs(num) > 10000){
			    result = num/10000;
				result = result.toFixed(0) + "万";
			   }				   
               return result;  
			};		
			
			function changeCss(obj,id){				
				var alist = document.getElementById(id).getElementsByTagName("a");					
				for(var i = 0; i < alist.length; i++){									
					alist[i].style.color = "#E5E5E5"; //给所有a标签赋原色
					if(alist[i].id == "hl"){
						alist[i].style.color = zdycolor; //自定义板块高亮
					}
				}
				ranking();	
				obj.style.color = "#00FFFF"; //令当前标签高亮
							
			}
			
			
			//js日期比较( 要求日期格式：yyyy-mm-dd)
			 function DateBiJiao(firstDate, lastDate) {
				var arr = firstDate.split("-");
				var firsttime = new Date(arr[0], arr[1], arr[2]);
				var firsttimes = firsttime.getTime();

				var arrs = lastDate.split("-");
				var  lasttime = new Date(arrs[0], arrs[1], arrs[2]);
				var  lasttimes =  lasttime.getTime();

				if (firsttimes> lasttimes) {
					return false;
				}
				else
					return true;
			}
			
			var k = 0;  //切换股票
			var gpdm = "";
			var gpmc = "";				
			function getSource() {
				var u = decodeURI(window.location.href);								
				var dm = "";
				if(u.indexOf("##") > -1){
					var gp = u.split('##');				
					dm = gp[1];
					gpmc = gp[2];					
					if(dm == gpdm){
						k = 0;						
					}else{
						k = 1;
						q = 0;
						q1 = 0;
						q2 = 0;
						q3 = 0;
					}				
				}else{
					dm = "600000";
					gpmc = "浦发银行";
				}
				if(gpdm == "" || k == 1){  //切换股票
					gpdm = dm;					
					if(q1 + q2 + q3 == 0){
						//writeSource1();   //涨停原因
						setTimeout(function(){writeSource1()}, 100);
					}
					
					//writeSource2();   //精选板块					
					setTimeout(function(){writeSource2()}, 100);					
				}
				if(ds == 1){ //定时刷新
					setTimeout(function(){writeSource2()}, 100);					
					ds = 0;
				}
			}
			
			
			var yy = "";			
			function writeSource1() { 
				var div = document.getElementById('towrite1');
				var sx = "<a style='float:right'  href='javascript:void(0)' id='sx' onclick='updatex()'>停止刷新</a>";
				var yt = '<font id="bt" size="2" style="padding-left:30px;color:#FFFF00;"></font>'
				var title = "涨停原因：";
				div.innerHTML = '<h4>个股详情：' + gpdm + "&nbsp;&nbsp;&nbsp;" + gpmc + yt + sx + '</h4>';
				if(k == 1){
					$("#bt").text('载入数据……');
				}
				var url11 = "http://127.0.0.1:8880/w1/api/index.php?a=GetKLineZhangTing&apiv=w26&c=StockLineData&StockID=" + gpdm; 														
				var url12 = "http://127.0.0.1:8881/w1/api/index.php?a=GetDayZhangTing&st=1&apiv=w26&c=HisLimitResumption&StockID=" + gpdm;
				var res1 = [];
				$.ajax({
					type: "get",
					url: url11,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res1 = data.List;
					}
				});
				
				var data2 = "";
				var res2 = [];
				$.ajax({
					type: "get",
					url: url12,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res2 = data.List;						
					}
				});
				
				//document.write(data1);	
				//document.write("<br><br>"+data2);
				
				//涨停原因
				if(res1.length > 0){
					var data1 = JSON.stringify(res1);
					var PZSCode = res1[0].PZSCode;
					var ZSCode = res1[0].ZSCode;					
					yy = GetZtyy(PZSCode,ZSCode);
					
					title = "涨停原因：";
					if(res1[0].Type == 1){
						title = "大涨原因：";
					}
					
					var ztyy = "";
					var transform_aa = [           
						{"tag":"ul", children:function(){return(json2html.transform(this, transform_bb));}}
					];									
					var transform_bb=								
					{"tag":"p style='color:#FFE1E1'", children:function(){
						var jx = "<td><a style='color:#FFE1E1; position:absolute; right:30px;' href='javascript:void(0)' onclick='updates()'>" + "详情" + "</a></td>";											
						ztyy = this.GNSM;
						return("<b>" + this.Date + "：" + yy + "&nbsp;&nbsp;&nbsp;&nbsp;" + this.SCLT + jx + "</b>");						
					}};
										
					var html = json2html.transform(data1, transform_aa);										
					div.innerHTML += '<ul><b style="color:#FFE1E1">' + title + '</b></ul>' + html;
					
					//添加分类Div
					var newDiv = document.createElement("div");
					newDiv.id = "xq";
					newDiv.style.display = "none";
					div.appendChild(newDiv);
					var div1 = document.getElementById("xq");
					div1.innerHTML += "<p>" + ztyy + "</p>" ;	
					temp1 = "";	
				}
				
				//前次
				if(res1.length == 0 && res2.length > 0){
					var data2 = JSON.stringify(res2);
					yy = res2[0].Reason.split("；")[0];					
					yy = yy.replace("(","（").replace(")","）");
					title = "前次涨停原因：";					
					if(res2[0].Type == 1){
						title = "前次大涨原因：";
					}
					var ztyy = "";
					var transform_aa = [           
						{"tag":"ul", children:function(){return(json2html.transform(this, transform_bb));}}
					];					
					var transform_bb=								
					{"tag":"p style='color:#FFD0E8'", children:function(){
						var jx = "<td><a style='color:#FFD0E8; position:absolute; right:30px;' href='javascript:void(0)' onclick='updates()'>" + "详情" + "</a></td>";											
						ztyy = this.GNSM;
						return("<b>" + this.Date + "：" + yy + "&nbsp;&nbsp;&nbsp;&nbsp;" + this.SCLT + jx + "</b>");						
					}};
										
					var html = json2html.transform(data2, transform_aa);										
					div.innerHTML += '<ul><b style="color:#FFD0E8">' + title + '</b></ul>' + html;
					
					//添加分类Div
					var newDiv = document.createElement("div");
					newDiv.id = "xq";
					newDiv.style.display = "none";
					div.appendChild(newDiv);
					var div1 = document.getElementById("xq");
					div1.innerHTML += "<p>" + ztyy + "</p>" ;	
					temp1 = "";	
				}
				
				//同花顺速递
				var sc = "";
				if(gpdm.substr(0 , 1) == "6"){
					sc = "17";
				}else{
					sc = "33";
				}
				var url3 = "https://eq.10jqka.com.cn/stockCourier/api/courier/eventData/" + sc + "/" + gpdm + ".txt";			
				var res3 = [];
				$.ajax({
					type: "get",
					url: url3,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res3 = data.data.events;
					}
				});
				
				
				if(res3.length > 0){						
					function up(a,b){
						var aa = a.ctime;
						var bb = b.ctime;					
						if(a.catename == "涨停分析"){
							aa = 0;
						}
						if(b.catename == "涨停分析"){
							bb = 0;
						}					
						return aa - bb					
					}
					res3.sort(up);
					var data3 = JSON.stringify(res3);
					
					var dq = "<td><a style='position:absolute; right:30px;' href='javascript:void(0)' onclick='updatest()'>" + "详情" + "</a></td>";
					div.innerHTML += "<ul><b>同花顺速递：（" + res3.length + "项）" + dq + "</b></ul>";
					//添加分类Div
					var newDiv3 = document.createElement("div");
					newDiv3.id = "txq";
					newDiv3.style.display = "none";						
					div.appendChild(newDiv3);
					div3 = document.getElementById("txq");
					
					var transform_aa1 = [           
					{"tag":"p", children:function(){return(json2html.transform(this, transform_bb1));}}
					];
											
					var transform_bb1=												
					{"tag":"ul", children:[									
					{"tag": "li style=color:#00FFFF;", "html":function(){
						if(this.catename == "龙虎榜"){							
							var url = "http://www.treeid/dlghttp://page.tdx.com.cn:7615/site/kggx/tk_ygzl_lhb.html?info=xxxxxx&amp;pageId=dpyd&amp;color=0&amp;bkcolor=000000"
							var lhb = "<a href='" + url + "' style='color:#FF00FF;'>" + this.catename + "：" + this.date + "</a>";							
							return(lhb);
						}else{
							return(this.catename + "：" + this.date);
						}
					
					}},
					{"tag": "p", "html": function(){
						if(this.catename == "涨停分析"){
							return(this.title.replace("涨停分析:","<p style=color:#F5FFFA;>").replace("｜","：</p>"));
						}else{
							return(this.content);
						}
					}},						
					{"tag": "p style=color:#FFF5EE;", "html":"${desc}"}, 						
					]};
					
					var html1 = json2html.transform(data3, transform_aa1);	
					div3.innerHTML += html1;
					temp12 = "";
				}
				
				setTimeout(function(){getdcrd()}, 100);  //东财热点 延时执行
				
				if(ztxq == 1 && ztyy != ""){  //显示涨停原因
					updates();
				}
				if(sdxq == 1){    //显示同花顺速递
					updatest();
				}					
			}	
			
			function GetZtyy(pZSCode,ZSCode) {
				var url1 = "http://127.0.0.1:8880/w1/api/index.php?a=GetFeaturedSection&c=StockL2Data&apiv=w26&StockID=" + gpdm;
				var res1 = [];
				$.ajax({
					type: "get",
					url: url1,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res1 = data.info;
					}
				});
				var aa = "";
				var bb = "";
				var yy = "";
				if(pZSCode != ""){
					for (var i = 0; i < res1.length; i++) {	
						if(res1[i].indexOf(pZSCode) > -1){
							aa = res1[i][1]
						}
						if(res1[i].indexOf(ZSCode[0]) > -1){
							bb = res1[i][1]
						}
					}
					yy = aa + "（" + bb + "）";
				}else{				
					for (var i = 0; i < ZSCode.length; i++) {	
						for (var j = 0; j < res1.length; j++) {	
							if(res1[j].indexOf(ZSCode[i]) > -1){
								yy += res1[j][1] + "+";
							}
						}						
					}
					yy = yy.substr(0,yy.length - 1);
				}
				return yy;
			}
			
			//东财热点
			function getdcrd() {
				var div = document.getElementById('towrite1');
				var url =  "https://vipmoney.eastmoney.com/collectapi/ranking/GubaHotTopicNew?code=" + gpdm;				
				var res = [];
				$.ajax({
					type: "get",
					url: url,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));
						res = data.re[gpdm]
					}
				});
				
				var rxq = "<td><a style='position:absolute; right:30px;' href='javascript:void(0)' onclick='updaterd()'>" + "详情" + "</a></td>";					
				var dcrd = "";				
				if(res.length > 0){
					dcrd = res[0].name;
					var rdid = res[0].htid;
					dcrd = "<ul><b>东财热点：<font color=#FFD700>" + dcrd + "</font>" + rxq + "</b></ul>";
									
					div.innerHTML += dcrd;
					//添加分类Div
					var newDiv2 = document.createElement("div");
					newDiv2.id = "dcrd";
					newDiv2.style.display = "none";						
					div.appendChild(newDiv2);
					var div2 = document.getElementById("dcrd");
					
					var url1 = "http://gubatopic.eastmoney.com/interface/GetData.aspx"; 
					var res1 = [];
					$.ajax({
						type: "post",
						url: url1,
						data : "param=htid=" + rdid + "&path=newtopic/api/Topic/TopicDetailsRead",
						contentType : "application/x-www-form-urlencoded;charset=UTF-8",
						dataType: "json",
						async : false,
						cache:false,
						timeout:3000,					
						success: function(data) {
							//alert(JSON.stringify(data))						
							//document.write(JSON.stringify(data));							
							res1 = data.re;									
						}
					});			
					
					<!-- rds = rds.replace(/\s+/g,"").replace(/<br>/g,"").replace(/[\r|\n]/g,"");						 -->					
					var rdjd = res1.lead;
					div2.innerHTML += "<ul style='margin-left:-5px;'>" + rdjd + "</ul>";					
					temp21 = "";
					if(rdxq == 1){    //显示东财热点
						updaterd();
					}
				}
			}
			
			//东财热点
			var q3 = 0;
			var temp21 = "";					
			function updaterd() {			
				if(document.getElementById("dcrd")){					
					div = document.getElementById("dcrd");
					if(temp21.indexOf("dcrd") == -1){
						temp21 += "dcrd" + ";";
						div.style.display = "block";
						div.style.border="1px solid #999";
						div.style.color = "#FFFFE0";
						q3 = 1;
					}else{
						temp21 = temp21.replace("dcrd" + ";" , "");
						div.style.display = "none";
						q3 = 0;
					}
				}				
			}
			
			//涨停原因
			var q1 = 0;
			var temp1 = "";					
			function updates() {			
				if(document.getElementById("xq")){					
					div1 = document.getElementById("xq");
					if(temp1.indexOf("xq") == -1){
						temp1 += "xq" + ";";
						div1.style.display = "block";
						div1.style.border="1px solid #999";
						div1.style.color = "#FFFFE0";
						q1 = 1;
					}else{
						temp1 = temp1.replace("xq" + ";" , "");
						div1.style.display = "none";
						q1 = 0;
					}
				}					
			}
			
			//同花顺速递
			var q2 = 0;
			var temp12 = "";					
			function updatest() {			
				if(document.getElementById("txq")){					
					div12 = document.getElementById("txq");
					if(temp12.indexOf("txq") == -1){
						temp12 += "txq" + ";";
						div12.style.display = "block";
						div12.style.border="1px solid #999";
						div12.style.color = "#FFFFE0";
						q2 = 1;
					}else{
						temp12 = temp12.replace("txq" + ";" , "");
						div12.style.display = "none";
						q2 = 0;
					}
				}
			}
			
			
			var temp2 = "";	
			var q = 0;	//是否在查看详情		
			function updatexq(ss) {	
				if(document.getElementById(ss)){					
					div2 = document.getElementById(ss);
					if(temp2.indexOf(ss) == -1){
						temp2 += ss + ";";
						div2.style.display = "block";
						div2.style.whiteSpace = "normal";
						div2.style.border="1px solid #999";
						div2.style.color = "#FFFFE0";
					}else{
						temp2 = temp2.replace(ss + ";" , "");
						div2.style.display = "none";
					}
				}
				if(temp2 == ""){  //查看详情时不刷新				
					q = 0;
				}else{
					q = 1;
				}
			}
						
			function updatex() {				
				aObj = document.getElementById('sx');
				if(aObj.innerText == "停止刷新"){
					z = 0;
					aObj.innerText = "自动刷新";
					aObj.style.color = "#ADFF2F";
				}else if(aObj.innerText == "自动刷新"){
					z = 1;
					aObj.innerText = "停止刷新";
					aObj.style.color = "#E5E5E5";					
				}
			}
						
			function updated() {
				z = 0;			
				aObj = document.getElementById('sx');
				if(aObj.innerText == "停止刷新"){					
					aObj.innerText = "自动刷新";
					aObj.style.color = "#ADFF2F";
				}					
			}
			
			function UnUnicode(str) {
				return unescape(str.replace(/\\/g, "%"));
			}
			
			function writeSource2() { 
				var div1 = document.getElementById('towrite2');				
				div1.innerHTML = "<h4 style='color:#FFFF00'>精选板块</h4>";	
				var text = load("个股详情自定义板块.txt");	
				bka = text.split("[高亮板块]")[1].split("[过滤板块]")[0];			
				bkb = text.split("[过滤板块]")[1];			
				
				var url1 = "http://127.0.0.1:8880/w1/api/index.php?a=GetFeaturedSection&c=StockL2Data&apiv=w26&StockID=" + gpdm;
				var res1 = [];
				$.ajax({
					type: "get",
					url: url1,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res1 = data.info;
					}
				});

				var url2 = "https://apparticle.longhuvip.com/w1/api/index.php?a=GetConceptJXBKw23&apiv=w24&c=StockF10Basic&StockID=" + gpdm;
				var res2 = [];
				$.ajax({
					type: "get",
					url: url2,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res2 = data.List;
					}
				});
				//document.write("<br><br>");
								
				var res = [];
				for (var i = 0; i < res1.length; i++){
					var aa = res1[i] ;
					res.push({"code":aa[0],"name":aa[1],"zf":aa[2]});							
				}
				for (var i = 0; i < res2.length; i++){
					var aa = res2[i];
					var code = aa.CCode;
					var a = res.findIndex((v) => {  //(findIndex)判断数组有无指定对象   
						return v.code ===  code;
					});
					if(a == -1){
						res.push({"code":code,"name":aa.CName,"zf":null});
					}												
				}
				//document.write(JSON.stringify(res));
											
				for (var i = 0; i < res.length; i++){
					var code = res[i].code;						
					var name = res[i].name;
					if(bkb.indexOf(name) == -1){  //自定义板块过滤
						var zf = res[i].zf;
						var zfs = "";
						if(zf != null){
							zfs = "&nbsp;涨幅：" + zf + "%";
						}
						
						var ys = "";
						if(bka.indexOf(name) > -1){
							ys = " style='color:" + zdycolor + "' id = 'hl'";  //自定义板块高亮
						}else{
							ys = " id='" + name;
						}
						
						var bks = "<a href='javascript:void(0)'" + ys + "' onclick='changeCss(this,\"towrite2\");update(" + "\"" +
									code + "\"+\"#\"+" + "\"" + name + "\"" + ")'>" + ( i + 1) + "、" +
									 "&nbsp;" + name + zfs + "</a>"	;									 
						var jx = "<td><a href='javascript:void(0)' onclick='updatexq(888" + code + ")'>" + "详情" + "</a></td>";						
						bks = bks + jx;	
						//alert(bks)
						var a = res2.findIndex((v) => {  //(findIndex)判断数组有无指定对象   
							return v.CCode ===  code;
						});
						var xq = "";
						if(a > -1){
							var arrfind = res2.find(function (item) {
								return item.CCode == code
							});
							xq = arrfind.Analysis; 
							if(xq == ""){
								xq = "暂无";
							}
						}else{
							xq = "暂无";
						}						
						var bkdm = code;	

						subclass(bkdm , bks , xq);						
						
						//切换股票 显示首个板块						
						if(k == 1 && i == 0 && y == 1){
							temp = code + ";";
							update(code + "#" + name);
							//alert(name)
							//setTimeout(function(){update(code + "#" + name)}, 100);
						}	

						if(bdm == "" && k == 0){						
							bdm = code;
							bkm = name;
						}
					}					
				}
				
				//刷新不切换板块
				if(bdm != ""){	
					temp = bdm + ";";
					update(bdm + "#" + bkm);					
				}		
				
				//常规板块
				var url3 = "https://apparticle.longhuvip.com/w1/api/index.php?a=GetConceptw23&c=StockF10Basic&apiv=w29&StockID=" + gpdm;
				var res3 = [];
				$.ajax({
					type: "get",
					url: url3,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res3 = data.List;
					}
				});
				
				div1.innerHTML += "<br><h4 style='color:#FFFF00'>常规板块</h4>";
				for (var i = 0; i < res3.length; i++){
					var aa = res3[i];
					var code = aa.CCode;
					var name = aa.CName;
					var xq = aa.Analysis;
					var ys = "";							
					if(i == 0){
						ys = " style='border: 2px solid #FFE4B5;padding-right:10px;'";  //标记首行
					}
					<!-- var bks = "<a href='javascript:void(0)' id='" + name + "' onclick='changeCss(this,\"towrite2\");update(" + "\"" + -->
								<!-- code + "\"+\"#\"+" + "\"" + name + "\"" + ")'>" + ( i + 1) + "、" + -->
								 <!-- "&nbsp;" + name + "</a>"	;									  -->
					
					var bks = "<a href='javascript:void(0)'" + ys + "' onclick='changeCss(this,\"towrite2\");update(" + "\"" +
								code + "\"+\"#\"+" + "\"" + name + "\"" + ")'>" + ( i + 1) + "、" +
								 "&nbsp;" + name + "</a>"	;				 
					var jx = "<td><a style='position:absolute; right:5px;' href='javascript:void(0)' onclick='updatexq(" + ( i + 1) + "888" + code + ")'>" + "详情" + "</a></td>";						
					div1.innerHTML += "<p>" + bks + jx + "</p>";
					
					//添加详情
					var newDiv = document.createElement("div");
					newDiv.id = ( i + 1) + "888" + code;
					newDiv.style.display = "none";
					newDiv.style.whiteSpace = "normal";
					div1.appendChild(newDiv);
					
					div2 = document.getElementById(i + 1 + "888" + code);
					div2.innerHTML = xq;							
				}
				
				//变色
				var interval = setInterval(function() {
					if(yy != ""){	
						ranking();							
						clearInterval(interval);							
					}					
				},100);	

				$("#bt").text('');
			}
			
			//子类
			function subclass(bkdm , bks, xq) {
				var div1 = document.getElementById('towrite2');
				var url = "http://127.0.0.1:8880/w1/api/index.php?a=SonPlate_Info&c=ZhiShuRanking&PhoneOSNew=1&apiv=w26&DeviceID=6575961a-b25b-3831-aa2b-4a373b51b256&VerSion=5.12.0.0&PlateID=" + bkdm; 
				var res = [];
				$.ajax({
					type: "get",
					url: url,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));	
						for (i = 0; i < data.List.length; i++){
							var aa = data.List[i];
							res.push({"code":aa[0],"name":aa[1],"qd":keepTwoDecimal(aa[2])});
						}
						function up(a,b){
							return b.qd-a.qd
						}
						res.sort(up);
					}
				});
				if(res.length > 0){
					var dms = bks.split('、');					
					div1.innerHTML += "<p>" + dms[0] + "、★" + dms[1] + "</p>";
					//添加详情
					var newDiv1 = document.createElement("div");
					newDiv1.id = "888" + bkdm;
					newDiv1.style.display = "none";					
					document.getElementById("towrite2").appendChild(newDiv1);
					
					var div2 = document.getElementById("888" + bkdm);
					div2.innerHTML += xq;
						
					//添加分类Div
					var newDiv = document.createElement("div");
					newDiv.id = bkdm;
					newDiv.style.display = "none";
					document.getElementById("towrite2").appendChild(newDiv);
					
					var data = JSON.stringify(res);
					var transform_ee1 = [           
					{"tag":"ul", children:function(){return(json2html.transform(this, transform_ff1));}}
					];

					var transform_ff1= 
					{"tag":"p", children:[
					{"tag":"p", children:[
					{"tag": "li", "html":"<a href='javascript:void(0)' id='" + bkdm + "' onclick='changeCss(this,this.id);update(\"${code}\"+\"#\"+\"${name}\")'>${name}&nbsp;强度：${qd}</a>"}
					]}]};

					var html3 = json2html.transform(data, transform_ee1);		
					var div = document.getElementById(bkdm);
					div.innerHTML += html3;								
				}else{
					div1.innerHTML += "<p>" + bks + "</p>";
					//添加详情
					var newDiv1 = document.createElement("div");
					newDiv1.id = "888" + bkdm;
					newDiv1.style.display = "none";
					newDiv1.style.whiteSpace = "normal";
					document.getElementById("towrite2").appendChild(newDiv1);
					
					div2 = document.getElementById("888" + bkdm);
					div2.innerHTML += xq;
				}							
			}
			var temp = "";
			var bdm = "";
			var bkm = "";
			var y = 1;	//爆发原因开关
			var order = 1;
			var type = 6;
			var old = 1;
			var rn = 6;
			bj = [];
			function update(ss) {
				y = 1;
				if(ss != "0"){
					var dms = ss.split('#');					
					bdm = dms[0];
					bkm = dms[1];
					//alert(temp);
					if(document.getElementById(bdm)){					
						div1 = document.getElementById(bdm);
						if(temp.indexOf(bdm) == -1){
							temp += bdm + ";";
							div1.style.display = "block";
							div1.style.border = "1px solid #646464";																				
						}else{
							temp = temp.replace(bdm + ";" , "");
							div1.style.display = "none";
						}
					}
				}
				var bfyy = "<a style='padding-left:0px' href='javascript:void(0)' onclick='updateb()'>【原因】</a>";
				var zz = "<a style='float:right;margin-right:5px;' href='javascript:void(0)' onclick='updatez()'>最正宗</a>";				
				var div = document.getElementById('towrite3');	
				div.innerHTML = '<h4>' + bkm + bfyy + zz + '</h4>';					
				var url = "http://127.0.0.1:8880/w1/api/index.php?Order=" + order + "&st=30&a=ZhiShuStockList_W8&c=ZhiShuRanking&PhoneOSNew=1&old=" + old + "&apiv=w21&Type=" + type + "&DeviceID=6575961a-b25b-3831-aa2b-4a373b51b256&VerSion=5.12.0.0&PlateID=" + bdm + "&"; 												
				var res = [];
				$.ajax({
					type: "get",
					url: url,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						for (var i = 0; i < data.list.length; i++){
							var aa = data.list[i];
							//res.push({"code":aa[0],"name":aa[1],"zf":aa[6],"zs":keepTwoDecimal(aa[9]),"lz":aa[24],"zl":aa[2],"lb":aa[23],"zt":aa[39]});	
							res.push({"code":aa[0],"name":aa[1],"zf":aa[6],"zs":keepTwoDecimal(aa[9]),"zlje":NumberTransform(aa[13]),"lzcs":aa[40],"lz":aa[24],"zl":aa[2],"lb":aa[23],"zt":aa[39]});		
						}											
					}
				});
				
				var json = res;	
				//创建table					
				var table=document.createElement("table");										
				var thead=document.createElement("thead");
				table.appendChild(thead);					
				var tr=document.createElement("tr");
				thead.appendChild(tr);					
				
				var m = 0;
				var v = 0;
				var b = 0;
				bj = [];
				for(var key in json[0]){  //表头													
					key = key.replace('code','代码').replace('name','名称').replace('zf','涨幅%').replace('zlje','主力净额').replace('lzcs','领涨次数');
					key = key.replace('lb','连板').replace('zt','主题').replace('zs','涨速%').replace('zl','主力').replace('lz','领涨');
					var th=document.createElement("th");						
					th.innerHTML=key;						
					tr.appendChild(th);					
					if(key == "领涨" || key == "主力" || key == "连板" || key == "主题"){
						bj.push(m)
						th.style.color = "#FFA500";	
					}					
					if(m == rn){
						th.style.color = "#FFFF80";						
					}
					m++;
				}
									
				var tbody=document.createElement("tbody");					
				table.appendChild(tbody);
				
				//遍历json
				for(var i = 0; i < json.length; i++){					
					var tr=document.createElement("tr");						
					var p = 1;	
					var dm = "";
					var mc = "";					
					for(var key in json[i]){ //行元素遍历					
						var td=document.createElement("td");							
						
						var rc = json[i][key];
						if(p == 1){  //代码列
							dm = rc;
							tr.id = dm;
						}				
						td.innerHTML = "<a href=http://www.treeid/code_" + dm + " id='" + p + "' onclick='updated();changeTCss(this,\"" + dm + "\",\"gg\")'>" + rc + "</a>";
							
						if(bj.indexOf(p - 1) > -1){	
							td.getElementsByTagName("a")[0].style.color = "#FFA500";  
						}
						if(p == rn + 1){														
							var value = parseFloat(JSON.stringify(rc).replace('万','').replace('亿','').replace(/"/,''));
							if(!isNaN(parseFloat(value)) && isFinite(value)){  //判断列是否为数字
								if(value >= 0){
									td.getElementsByTagName("a")[0].style.color = "#FF6633";
								}else{
									td.getElementsByTagName("a")[0].style.color = "#00FF00";
								}
							}else{								
								td.getElementsByTagName("a")[0].style.color = "#FF6633";								
							}
						}
						
						if(rc == "破板"){
							td.getElementsByTagName("a")[0].style.color = "#00FF00"; 
						}
						
						tr.appendChild(td);
						p++;
					}						
					tbody.appendChild(tr);
				}					
				div.style.whiteSpace = "nowrap";				
				div.appendChild(table);
				table.id = "gg";					
				
				changeTable(table,"0#3#4#5");
				makeSortable(table);			
				hover();
				
				//排序、高亮
				thclick();
				changeTCss(objt,trid,"gg");		
			}
			
			//隐藏某列				
			function changeTable(table,ss) {	
				var trs = table.rows;
				ss = ss + '#';
				var aa = ss.split('#');
				for (var j = 0; j < aa.length; j++) {
					if(aa[j] != ""){
						for (var i = 0, len = trs.length; i < len; i++) {					
							var p = aa[j];
							var cell = trs[i].cells[p]; 
							cell.style.display = 'none';
						}
					}
				}					
			}
			
			var sfx = 0;  //自动刷新开关
			var fls = false;  //排序方向
			function makeSortable(table) {
				var headers=table.getElementsByTagName("th");
				for(var i=0;i<headers.length;i++){				
					(function(n){
						var flag=false;
							
						headers[n].onclick=function(){
						//alert(n)
							rn = n;
							gl = headers[n].textContent;	//获取						
							
							if(n == 2){		       //涨幅													
								old = 0;
								type = 6;														
							}else if(n == 3){		//涨速						
								type = 7;															
							}else if(n == 4){	    //净额						
								type = 1;
							}else if(n == 5){	    //领涨次数						
								type = 27;
							}
							
							if(n >= 2 && n <= 5){
								if(order == 1){
									order = 0;									
								}else{
									order = 1;									
								}
								update("0");
							}else{
								if(type != 6 || old != 1){
									type = 6;
									old = 1;
									order = 1;
									update("0");
								}
								showCol(n,bj);		//高亮
							}
							
							var tbody=table.tBodies[0];
							var rows=tbody.getElementsByTagName("tr");
							rows=Array.prototype.slice.call(rows,0);

							//基于第n个<td>元素的值对行排序
							rows.sort(function(row1,row2){
								headtxt = headers[n].textContent;								
								var cell1=row1.getElementsByTagName("td")[n];//获得第n个单元格
								var cell2=row2.getElementsByTagName("td")[n];																
								var val1=cell1.textContent||cell1.innerText;//获得文本内容
								var val2=cell2.textContent||cell2.innerText;
								if(headtxt.indexOf("名称") != -1 || headtxt=="主力" || headtxt.indexOf("主题") != -1){
									val1 = val1;
									val2 = val2;
								}else if(headtxt.indexOf("连板") != -1){								
									val1 = val1.replace("昨日首板","-1").replace("首板","1").replace("连板","");
									if(val1.indexOf("天")>-1){
										val1 = val1.split("天")[0];
									}else if(val1.indexOf("昨")>-1){
										val1 = 0;
									}else if(val1 == ""){
										val1 = -2;
									}										
									val1 = parseFloat(val1);
								
									val2 = val2.replace("昨日首板","-1").replace("首板","1").replace("连板","");
									if(val2.indexOf("天")>-1){
										val2 = val2.split("天")[0];
									}else if(val2.indexOf("昨")>-1){
										val2 = 0;
									}else if(val2 == ""){
										val2 = -2;
									}									
									val2 = parseFloat(val2);
								}else if(headtxt.indexOf("领涨") != -1){
									val1 = val1.replace("龙十","龙一十").replace("破板","1000");
									val2 = val2.replace("龙十","龙一十").replace("破板","1000");
									if(val1 == ''){
										val1 = '1001';
									}
									if(val2 == ''){
										val2 = '1001';
									}
									if(val1.indexOf("龙") != -1){
										val1 = ChineseToNumber(val1.replace("龙",""));										
									}										
									if(val2.indexOf("龙") != -1){
										val2 = ChineseToNumber(val2.replace("龙",""));
										
									}
									//val2 = parseFloat(val2);									
								}else{
									if(val1 == "-"){
										val1 = " ";
									}
									if(val2 == "-"){
										val2 = " ";
									}
									val1 = val1.replace(" ","0").replace("无","1000").replace("NaN","0");
									val2 = val2.replace(" ","0").replace("无","1000").replace("NaN","0");
									if(val1.indexOf("万") != -1){
										val1 = parseFloat(val1)*10000;
									}else if(val1.indexOf("亿") != -1){
										val1 = parseFloat(val1)*100000000;
									}else{
										val1 = parseFloat(val1);
									}
									
									if(val2.indexOf("万") != -1){
										val2 = parseFloat(val2)*10000;
									}else if(val2.indexOf("亿") != -1){
										val2 = parseFloat(val2)*100000000;
									}else{
										val2 = parseFloat(val2);
									}
								}
								if(val1<val2){
									return -1;
								}else if(val1>val2){
									return 1;
								}else{
									return 0;
								}
								
							});
							
							if(sfx == 1){   //自动刷新时，保持排序方向
								flag = fls;								
							}
							fls = flag;							
							sfx = 0;

							if(flag){
								rows.reverse();								
							}
							
							for(var i=0;i<rows.length;i++){
								tbody.appendChild(rows[i]);
							}
							
							flag=!flag;									
						}
					}(i));
				}
			}
			
			function showCol(iCol,arr){	 //(选中列，标记列)	
				var oTable = document.getElementsByTagName('table')[0];						
				//表头
				var th = oTable.getElementsByTagName("th");						
				for (var i=0;i < th.length; i++){	    //列遍历
					th[i].style.color = "#E5E5E5";      //还原					
					if(arr.length > 0 && arr.indexOf(i) > -1){  //BJ列高亮
						th[i].style.color = "#FFA500";
					}
					th[iCol].style.color = "#FFFF80";	//选中				
				}
				
				var tr = oTable.getElementsByTagName("tr");	
				for (var i=1;i < tr.length; i++){	//行遍历
					var otagsA = tr[i].getElementsByTagName("a");
					for (var j=0;j < otagsA.length; j++){	//列遍历						
						otagsA[j].style.color = "#E5E5E5";	//还原											
						if(arr.length > 0 && arr.indexOf(j) > -1){  //BJ列高亮
							otagsA[j].style.color = "#FFA500";
						}
					}
					var value = otagsA[iCol].innerText.replace(/(万)|(亿)/g,'');
					if(!isNaN(parseFloat(value)) && isFinite(value)){  //判断列是否为数字
						if(parseFloat(value) >= 0){
							otagsA[iCol].style.color = "#FF6633";     //正负颜色
						}else{
							otagsA[iCol].style.color = "#00FF00";
						}
					}else{						
						otagsA[iCol].style.color = "#FF6633";						
					}
					
					//破板
					for (var j=0;j < otagsA.length; j++){	//列遍历
						var value = otagsA[j].innerText;
						if(value == "破板"){
							otagsA[j].style.color = "#00FF00";
						}
					}					
				}					
			}	
			
			var chnNumChar = {零:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9};

			var chnNameValue = {
			  十:{value:10, secUnit:false},
			  百:{value:100, secUnit:false},
			  千:{value:1000, secUnit:false},
			  万:{value:10000, secUnit:true},
			  亿:{value:100000000, secUnit:true}
			}

			function ChineseToNumber(chnStr){
			  var rtn = 0;
			  var section = 0;
			  var number = 0;
			  var secUnit = false;
			  var str = chnStr.split('');

			  for(var i = 0; i < str.length; i++){
				var num = chnNumChar[str[i]];
				if(typeof num !== 'undefined'){
				  number = num;
				  if(i === str.length - 1){
					section += number;
				  }
				}else{
				  var unit = chnNameValue[str[i]].value;
				  secUnit = chnNameValue[str[i]].secUnit;
				  if(secUnit){
					section = (section + number) * unit;
					rtn += section;
					section = 0;
				  }else{
					section += (number * unit);
				  }
				  number = 0;
				}
			  }
			  return rtn + section;
			}
			
			var trid = "";
			var objt = "";
			function changeTCss(obj,hid,id){
				objt = obj;
				var tlist = document.getElementById(id).getElementsByTagName("tr");					
				for(var i = 0; i < tlist.length; i++){														
					tlist[i].style.backgroundColor = bkcolor; 					
				}
				trid = hid;
				var tr = document.getElementById(hid);
				if(tr){
					tr.style.backgroundColor = "#483D8B";
				}				
			}
			
			function hover(){  //鼠标经过
				var rows = document.getElementsByTagName('tr');
				for(var i=0;i<rows.length;i++){
					rows[i].onmouseover=function(){						
						if(this.id != ""){  //过滤表头
							this.style.background="#800000";
						}
					}
					rows[i].onmouseout=function(){
						if(this.id != ""){  //过滤表头
							if(this.id != trid){  //过滤选中行
								this.style.background=bkcolor;
							}else{
								this.style.background="#483D8B";
							}
						}						
					}					
				}
			}			
			
			function updatez() {
				var dm = bdm; 			 						
				var url1 = "http://127.0.0.1:8880/w1/api/index.php?Order=1&ZZ=1&a=PlateIntroduction&st=30&c=ZhiShuRanking&PhoneOSNew=1&Index=0&apiv=w24&Type=2&DeviceID=6575961a-b25b-3831-aa2b-4a373b51b256&VerSion=5.12.0.0&PlateID=" + dm + "&"; 								
				var url2 = "http://127.0.0.1:8881/w1/api/index.php?Order=1&a=ZhiShuStockList_W8&st=30&c=ZhiShuRanking&PhoneOSNew=1&IsZZ=1&Index=0&apiv=w26&Type=6&DeviceID=6575961a-b25b-3831-aa2b-4a373b51b256&VerSion=5.12.0.0&PlateID=" + dm + "&Date=" + tt + "&"; 
				var url = url1;
				if(k == "1"){
					url = url2;
				}							
				
				var res = [];
				$.ajax({
					type: "get",
					url: url,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));	
						if(k == "0"){
							for (i = 0; i < data.List.length; i++){							
								res.push({"code":data.List[i][0],"name":data.List[i][1],"zf":data.List[i][3],"lzcs":data.List[i][4]});												
							}
						}else{
							for (i = 0; i < data.list.length; i++){							
								res.push({"code":data.list[i][0],"name":data.list[i][1],"zf":data.list[i][6],"lz":data.list[i][24],"zl":data.list[i][2],"lb":data.list[i][23]});
							}							
						}							
					}
				});			
							
				var data = JSON.stringify(res);
				data = '{\"list\":' + data + "}";
				//document.write(data);
				
				var transform_aa = [           
				{"tag":"p", children:function(){return(json2html.transform(this.list, transform_bb));}}
				];
				
				var transform_bb="";
				if(k == "0"){
					transform_bb= 
					{"tag":"p", children:[
					{"tag":"p", children:[											
					{"tag": "p", "html":"<a href='http://www.treeid/code_${code}' onclick='changeCss(this,\"towrite2\")'>${code} ${name}&nbsp;涨幅:${zf}%&nbsp;领涨次数:${lzcs}</a>"}, 
					]}]}; 
				}else{
					transform_bb= 
					{"tag":"p", children:[
					{"tag":"p", children:[											
					{"tag": "p", "html":"<a href='http://www.treeid/code_${code}' >${code} ${name}&nbsp;&nbsp;涨幅：${zf}%&nbsp;&nbsp;${lb}</a>"}, 
					]}]}; 
				}
				var html = json2html.transform(data, transform_aa);	
				var bfyy = "<a style='padding-left:10px;' href='javascript:void(0)' onclick='updateb()'>【爆发原因】</a>";
				var qb = "<a style='float:right;margin-right:2px;' href='javascript:void(0)' onclick='update(" + "0" + ")'>全部</a>";				
				var div = document.getElementById('towrite3');				
				div.innerHTML = '<h4>' + bkm + bfyy + qb + '</h4>';										
				div.innerHTML += html;
				div.style.whiteSpace = "nowrap";						
			}
			
			function updateb() {
				y = 0;	
				var dm = bdm; 			 
				var url4 = "http://127.0.0.1:8880/w1/api/index.php?a=GetBaseFaceListZDEvnArtNew&apiv=w26&c=ZhiShuL2Data&StockID=" + dm;				
				var url5 = "http://127.0.0.1:8881/w1/api/index.php?a=GetDayBaseFaceListZDEvnArt&st=10&c=ZhiShuKLine&apiv=w26&StockID=" + dm; 								
				
				var res4 = [];
				$.ajax({
					type: "get",
					url: url4,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res4 = data;								
					}
				});				

				var res5 = [];
				$.ajax({
					type: "get",
					url: url5,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res5 = data;									
					}
				});		
				
				var fh = "<a style='padding-left:10px' href='javascript:void(0)' onclick='update(" + "0" + ")'>【返回】</a>";
				var zz = "<a style='float:right' href='javascript:void(0)' onclick='updatez()'>最正宗</a>";				
				var div = document.getElementById('towrite3');				
				div.innerHTML = '<h4>' + bkm + fh + zz + '</h4>';	
				var rq = res4.Date;
				
				if(rq != ""){					
					var data = JSON.stringify(res4);
					data = '{"List":[' + data + ']}';					
					var day = new Date();
					gt = day.getTime();			
					mymonth = day.getMonth()+1;
					myday = day.getDate();
					if(mymonth >= 10){mymonth = mymonth;}else{mymonth = "0" + mymonth;}
					if(myday >= 10){myday = myday;}else{myday = "0" + myday;}
					tt = day.getFullYear() + "-" + mymonth + "-" + myday;													
					
					if(rq == tt){						
						var transform_aa = [           
						{"tag":"ul", children:function(){return(json2html.transform(this.List, transform_bb));}}
						];
						
						var transform_bb= 
						{"tag":"p", children:[
						{"tag":"li", children:[							
						{"tag": "p style=color:#FFFF00;font-size:14px;", "html":"${Date}：${BoomReason}"},
						{"tag": "p style=margin-top:-5px;color:#FFA500;font-size:14px;", "html":"${Title}"}, 					
						]}]}; 
						
						var html = json2html.transform(data, transform_aa);																						
						div.innerHTML += html;
					}
				}
				
				if(res5.List.length > 0){
					var data1 = JSON.stringify(res5);
					var transform_aa = [           
					{"tag":"ul", children:function(){return(json2html.transform(this.List, transform_bb));}}
					];
					
					var transform_bb= 
					{"tag":"p", children:[
					{"tag":"li", children:[							
					{"tag": "p style=color:#E1FFFF;font-size:14px;", "html":"${Date}：${BoomReason}"},
					{"tag": "p style=margin-top:-5px;color:#FFA500;font-size:14px;", "html":"${Title}"}, 
					]}]}; 
					
					var html = json2html.transform(data1, transform_aa);					
					div.innerHTML += html;
				}else if(res5.List.length == 0 && rq == ""){
					div.innerHTML += "暂无数据";	
				}
				div.style.whiteSpace = "normal";  //折行												
			}
			
			function ranking(){			
				var alist = document.getElementById("towrite2").getElementsByTagName("a");				
				for(var i = 0; i < alist.length; i++){
					yy = yy.replace(/ /g,"");
					var bk = alist[i].id;
					var y1 = "";
					var y2 = "";
					if(yy.indexOf("+")>-1){
						y1 = yy.split("+")[0];
						y2 = yy.split("+")[1];
					}else if(yy.indexOf("（")>-1){
						y1 = yy.split("（")[0];
						y2 = yy.split("（")[1].split("）")[0];
					}else{
						y1 = yy;
					}
					
					if(bk != ""){					
						if(y1 == bk || y2 == bk){
							
							alist[i].style.color = "#FFA500";
						}
					}					
				}				
			}
			
		</script>	
	</body>
</html>